﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
    <Style TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Label Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Padding="{TemplateBinding Padding}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                            Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Label.Style>
                            <Style TargetType="{x:Type Label}">
                                <Style.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Background" Value="#9ac8ff" />
                                    </Trigger>
                                    <Trigger Property="IsEnabled" Value="False">
                                        <Setter Property="Foreground" Value="Gray" />
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </Label.Style>
                    </Label>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DisplayDueDateButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border>
                        <interactivity:Interaction.Triggers>
                            <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                                <interactivity:InvokeCommandAction Command="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" />
                            </interactivity:EventTrigger>
                        </interactivity:Interaction.Triggers>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Style.Triggers>
                                    <!-- Hightlight the item that reached the due date as setup -->
                                    <DataTrigger Binding="{Binding DueDateStatus}" Value="ReachDueDate">
                                        <Setter Property="Background" Value="#9ac8ff" />
                                    </DataTrigger>
                                    <!-- Hightlight the item that reached the due time as setup -->
                                    <DataTrigger Binding="{Binding DueDateStatus}" Value="ReachDueTime">
                                        <Setter Property="Background" Value="#9ac8ff" />
                                    </DataTrigger>
                                    <!-- Hightlight the item that is overdue the due date & time as setup -->
                                    <DataTrigger Binding="{Binding DueDateStatus}" Value="Overdue">
                                        <Setter Property="Background" Value="#f4643d" />
                                    </DataTrigger>
                                    <!-- IsMouseOver trigger must be put on the bottom. Otherwize it would not work. -->
                                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=GridDueTimeDisplay}" Value="True">
                                        <Setter Property="Background" Value="LightGray" />
                                    </DataTrigger>
                                </Style.Triggers>
                                <Setter Property="Background" Value="#e6f3fb" />
                            </Style>
                        </Border.Style>
                        <TextBlock TextAlignment="Center" Padding="2">
								<ContentPresenter />
                        </TextBlock>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DisplayDueTimeButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border>
                        <interactivity:Interaction.Triggers>
                            <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                                <interactivity:InvokeCommandAction Command="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" />
                            </interactivity:EventTrigger>
                        </interactivity:Interaction.Triggers>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Style.Triggers>
                                    <!-- Hightlight the item that reached the due time as setup -->
                                    <DataTrigger Binding="{Binding DueDateStatus}" Value="ReachDueTime">
                                        <Setter Property="Background" Value="#9ac8ff" />
                                    </DataTrigger>
                                    <!-- IsMouseOver trigger must be put on the bottom. Otherwize it would not work. -->
                                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=GridDueTimeDisplay}" Value="True">
                                        <Setter Property="Background" Value="LightGray" />
                                    </DataTrigger>
                                </Style.Triggers>
                                <Setter Property="Background" Value="#e6f3fb" />
                            </Style>
                        </Border.Style>
                        <TextBlock TextAlignment="Center" Padding="2">
								<ContentPresenter />
                        </TextBlock>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SetPriorityButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock Background="{TemplateBinding Background}">
							<TextBlock.Style>
								<Style TargetType="{x:Type TextBlock}">
					                <Setter Property="Foreground" Value="White" />
					                <Setter Property="FontSize" Value="14" />
					                <Setter Property="TextAlignment" Value="Center" />
					                <Setter Property="Padding" Value="0" />
					                <Setter Property="Width" Value="20" />
					                <Setter Property="Height" Value="20" />
					                <Style.Triggers>
					                    <Trigger Property="IsMouseOver" Value="True">
					                        <Setter Property="Foreground" Value="DarkGray" />
					                    </Trigger>
					                </Style.Triggers>
					            </Style>
							</TextBlock.Style>
							<ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ImageButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="SysButtonImageBorder">
                        <Image x:Name="SysButtonImage" Source="{Binding ToolTip, RelativeSource={RelativeSource TemplatedParent}, 
                            Converter={StaticResource NormalImageButtonSourcePathConverter}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="SysButtonImage" Property="Source" Value="{Binding ToolTip, RelativeSource={RelativeSource TemplatedParent}, 
                                Converter={StaticResource HoverImageButtonSourcePathConverter}}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="SysButtonImageBorder" Property="Background" Value="AliceBlue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NoteImageButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="NoteButtonImageBorder">
                        <interactivity:Interaction.Triggers>
                            <interactivity:EventTrigger EventName="PreviewMouseLeftButtonDown">
                                <interactivity:InvokeCommandAction Command="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" />
                            </interactivity:EventTrigger>
                        </interactivity:Interaction.Triggers>
                        <Image Width="20" x:Name="NoteButtonImage" Source="/Resources/Images/Note-Contained.png" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Note}" Value="">
                            <Setter TargetName="NoteButtonImage" Property="Source" Value="/Resources/Images/Note-None.png" />
                        </DataTrigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="NoteButtonImage" Property="Source" Value="/Resources/Images/Note-Hover.png" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="NoteButtonImageBorder" Property="Background" Value="AliceBlue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="LeftPanelVisibilityControlButton" TargetType="{x:Type Button}">
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <TextBlock x:Name="ColorPresenter" Background="#92c0e0" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ColorPresenter" Property="Background" Value="LightBlue"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>